class CreateGastos < ActiveRecord::Migration
  def self.up
    create_table :egresos do |t|
      t.column :nombre, :string, :limit=>50, :null=>false
      t.column :desc, :text
    end
    
    create_table :gastos do |t|
      t.column :instructor_id, :integer, :null=>false
      t.column :monto, :float, :null=>false
      t.column :desc, :string, :limit=>100
      t.column :egreso_id, :integer, :null=>false
    end
    
    add_index :gastos, :instructor_id
    add_index :gastos, :egreso_id
  end

  def self.down
    drop_table :gastos
    drop_table :egresos
  end
end
